#!/bin/bash

# SERVER[1]="169.54.242.25"
# SERVER[2]="169.54.242.28"
# SERVER[3]="169.54.242.18"
# SERVER[4]="169.54.242.6"
# SERVER[5]="169.54.242.22"
# SERVER[6]="169.54.242.30"

  SERVER[1]=10.142.70.168
  SERVER[2]=10.142.70.142
  SERVER[3]=10.142.70.152
  SERVER[4]=10.142.70.154
  SERVER[5]=10.142.70.135
  SERVER[6]=10.142.70.181


  CLIENT[1]=10.120.16.88
  CLIENT[2]=10.120.16.126
  CLIENT[3]=10.120.16.119
  CLIENT[4]=10.120.16.68
  CLIENT[5]=10.120.16.76
  CLIENT[6]=10.120.16.79

  b=10.113.50.8

  backend=/niagara/test/svt_atelm/SL/backends
  PWD=/niagara/test/svt_atelm/SL/B01
  
  for i in {1..6}; do
    echo ssh root@$b "${backend} ${SERVER[$i]} backend$i"
    ssh root@$b "${backend} ${SERVER[$i]} backend$i &> ./backend$i.out" &
    sleep 20s
    echo ssh root@${CLIENT[$i]} "cd ${PWD}; ${PWD}/run0${i}Ar 10000"
    ssh root@${CLIENT[$i]} "cd ${PWD};${PWD}/run0${i}Ar 10000" &
    sleep 10s
  done
